$('.resetBtn').on('click',function() {
  let userPass = $('#userpass').val()
  let newPass = $('#newPass').val()
  let confirmPass = $('#confirmPass').val()
  if (userPass.trim().length == 0) {
    alert('请输入旧密码')
  }
  if (newPass.trim().length == 0) {
    alert('请输入新密码')
  }
  if (confirmPass.trim().length == 0) {
    alert('请输入确认密码')
  }
  $.ajax({
    type: 'put',
    url: '/users/password',
    data: {
      userPass: userPass,
      newPass: newPass,
      confirmPass: confirmPass
    },
    success: function(response) {
     alert('修改密码成功')
     setTimeout(function() {
      location.href = "/admin/login.html"
     }, 2000)
    },
    error: function() {
      alert('修改密码失败')
    }
  })
})